package com.li.sssp.general;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Component;

@Component
public class general_url {

	/**
	 * 获取当前url功能
	 * 
	 * @param getServletPath
	 *           当前url
	 * @param getQueryString()
	 *            获取url后查询参数
	 *@param url
	 *            完整的当前url
	 * @author guazi
	 * @version 0.1 2016-10-27
	 */
	public String getUrl(HttpServletRequest request) {
		String url = request.getServletPath();
		if (request.getQueryString() != null) {
			url += "?" + request.getQueryString();
		}
		url = url.replaceFirst("/", "");
		return url;
	}
}
